﻿using Ops.Mpc.States;
using Ops.Mpc.ExampleApplication.Polling.Controls.Models;

namespace Ops.Mpc.ExampleApplication.Polling.Controls.Actions
{
    public class InitializationStateAction : StateAction
    {
        protected override void OnExecute(object context)
        {
            base.OnExecute(context);
            PollingItemModel pollingItemModel = this.GetModel<PollingItemModel>();
            pollingItemModel.Name = this.Controller.Presenter.DataContext as string;
            pollingItemModel.Count = 0;
            this.Finish();
        }
    }
}
